package zy.blue7.im.handler.impl;

import io.netty.channel.Channel;
import zy.blue7.im.ClientContainer;
import zy.blue7.im.common.message.Message;
import zy.blue7.im.common.message.response.Result;
import zy.blue7.im.handler.ClientMessageHandler;
import zy.blue7.im.handler.ResultMessageHandler;

import java.awt.*;

/**
 * @author blue7
 * @version 1.0
 * @date 2022/3/4 9:22
 */
public class ResultMessageHandlerImpl implements ClientMessageHandler {
    @Override
    public void handle(Channel channel, Message message, Container container) {

        Result result = (Result) message;
        /**
         * 暂时从 容器中获取
         */
        ResultMessageHandler resultMessageHandler = ClientContainer.resultHandlerMap.get(result.getCode());

        resultMessageHandler.handle(channel, result, container);
    }
}
